Class ComparerZeroHashCodeEqualityComparer<T>

An equalityComparer compatible with a given comparer. All hash codes are 0, meaning that anything based on hash codes will be quite inefficient.

Note: this will give a new EqualityComparer each time created!

Type parameters:
T

Implements

System.Collections.Generic.IEqualityComparer<T>

Bases

object

Constructor overview

ComparerZeroHashCodeEqualityComparer<T>(System.Collections.Generic.IComparer<T> comparer)

Method overview

Equals(T item1, T item2) ,
Equals(object obj), Inherited from object ,
Finalize(), Inherited from object ,
GetHashCode(T item) ,
GetHashCode(), Inherited from object ,
GetType(), Inherited from object ,
MemberwiseClone(), Inherited from object ,
ToString(), Inherited from object

Constructor details

ComparerZeroHashCodeEqualityComparer<T>(System.Collections.Generic.IComparer<T> comparer) Create a trivial compatible with the comparer
Parameters:
comparer:

Method details

F bool Equals(T item1, T item2) Equality of two items as defined by the comparer.
Returns:
Parameters:
item1:
item2:
F int GetHashCode(T item) A trivial, inefficient hash fuction. Compatible with any equality relation.
Returns:0
Parameters:
item: